package com.fpc.cn.springbootutil.exception;

public class BusinessException extends RuntimeException {
    private Integer code;

    public BusinessException(ExceptionTypeEnum exceptionTypeEnum) {
        super(exceptionTypeEnum.getMsg());
        this.code = exceptionTypeEnum.getCode();
    }

    public BusinessException(String msg) {
        super(msg);
        this.code = 10000;
    }

    public BusinessException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public Integer getCode() {
        return this.code;
    }
}
